#ifndef DEXWIN_H
#define DEXWIN_H

#include <QFrame>

class QGridLayout;

class CWFrame;

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>

class DexWin : public QFrame
	{
		Q_OBJECT

		public:
			DexWin(Window, QWidget *parent = 0, Qt::WindowFlags f = 0);
			~DexWin();

			QFrame *getFrameSection(Qt::WindowFrameSection);
			void getWMSize();
			void updateWMName();

		protected:
			virtual void constructFrames();
			virtual void sendClientMessage(Atom, Window, long, long);

		private:
			Window clientId;
			QGridLayout *layout;
			CWFrame *frameTopLeft;
			CWFrame *frameTop;
			CWFrame *frameTopRight;
			CWFrame *frameLeft;
			QFrame *clientWidget;
			CWFrame *frameRight;
			CWFrame *frameBottomLeft;
			CWFrame *frameBottom;
			CWFrame *frameBottomRight;
			QFrame *titleBar;

			int hintMinWidth;
			int hintMinHeight;
			int hintMaxWidth;
			int hintMaxHeight;
			int hintBaseWidth;
			int hintBaseHeight;
			int hintIncWidth;
			int hintIncHeight;
			int hintMinX;
			int hintMinY;
			int hintMaxX;
			int hintMaxY;
			int m_width;
			int m_height;
			int m_x;
			int m_y;

		public slots:
			void closeWindow();
			void moveWindow(const QPoint &, const QPoint &);
			void setWindowTitle(const QString &);
	};

#endif // DEXWIN_H
